#include "asr.h"
extern "C"{ void * __dso_handle = 0 ;}
#include "setup.h"
#include "myLib/asr_servo.h"

uint32_t snid;
Servo servo_0;
Servo servo_13;
void ASR_CODE();

//{speak:小蝶-清新女声,vol:10,speed:10,platform:haohaodada}
//{playid:10001,voice:}
//{playid:10002,voice:}

/*描述该功能...
*/
void ASR_CODE(){
  set_state_enter_wakeup(10000);
  switch (snid) {
   case 1:
    servo_13.write(60);
    delay(1000);
    servo_13.write(90);
    exit_wakeup_deal(0);
    break;
   case 2:
    servo_13.write(120);
    delay(1000);
    servo_13.write(90);
    exit_wakeup_deal(0);
    break;
  }

}

void hardware_init(){
  vol_set(4);
  servo_0.write(90);
  vTaskDelete(NULL);
}

void setup()
{
  //{ID:0,keyword:"唤醒词",ASR:"丁真",ASRTO:"你好我是丁真"}
  //{ID:1,keyword:"命令词",ASR:"开灯",ASRTO:"科比1"}
  //{ID:2,keyword:"命令词",ASR:"关灯",ASRTO:"科比2"}
  servo_0.attach(0);
  servo_13.attach(13);
}